# -*- coding: utf-8 -*-
# @Time : 2022/11/14 13:29
# @Author : zhao
# @Email : liming7887@qq.com
# @File : CalculationBooleanResults.py
# @Project : mathematical_expression-py
from mathematical_expression.core.container.CalculationResults import CalculationResults


class CalculationBooleanResults(CalculationResults):
    """
    布尔比较计算结果存储对象，在该类中存储的都是来自计算组件的计算结果，以及运算级别层数等信息
    Boolean comparison calculation result storage object. In this class,
     the calculation results from calculation components and the number of operation levels are stored
    """
    result_layers: int
    calculation_source_name: str
    result: bool

    def __init__(self, result_layers: int, result: bool, calculation_source_name: str):
        """
        构造一个结果对象
        :param result_layers: 已经计算出结果数值的情况下，使用该形参进行赋值
        :param calculation_source_name: 来源，表明该结果对象的计算来源。
        """
        self.result_layers = result_layers
        self.result = result
        self.calculation_source_name = calculation_source_name

    def get_result_layers(self):
        return self.result_layers

    def get_calculation_source_name(self):
        return self.calculation_source_name

    def get_result(self) -> bool:
        """
        :return: 该类中存储的结果数据
        """
        return self.result
